package com.example.demodb.controller;

import com.example.demodb.entity.UserAdvice;
import com.example.demodb.service.UserAdviceService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class UserAdviceController {
    @Resource
    private UserAdviceService userAdviceService;

    @GetMapping("/UserAdviceController/findAll")
    @CrossOrigin
    public List<UserAdvice> findAll(){
        return userAdviceService.findAll();
    }

    @PostMapping("/UserAdviceController/addUserAdvice")
    @CrossOrigin
    public UserAdvice addUserAdvice(@RequestBody UserAdvice userAdvice){
        return userAdviceService.addUserAdvice(userAdvice);
    }


}
